import request from '@/utils/request';
import { AxiosPromise } from 'axios';

// 获得地区树
export const getAreaTree = async () : AxiosPromise<any[]> => {
  return request({
    url: '/tearoom/area/tree',
    method: 'get'
  });
};

// 获得 IP 对应的地区名
export const getAreaByIp = async (ip: string)  => {
  return request({
    url: '/tearoom/area/getByIp?ip=' + ip,
    method: 'get'
  });
};

// 获得 ID 对应的地区名
export const getAreaById = async (ids: string)  => {
  return request({
    url: '/tearoom/area/getById?ids=' + ids,
    method: 'get'
  });
};
